﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        btnSubmit.Visible = false;
        btnPrint.Visible = true;
        List<TextBox> AllTextBox = pnlBody.Controls.OfType<TextBox>().ToList<TextBox>();        
        List<Label> AllLabel = pnlBody.Controls.OfType<Label>().ToList<Label>();

        for (int i=0; i< AllLabel.Count; i++)
        {
            string value = AllTextBox[i].Text;
            AllLabel[i].Text = value.Trim() == string.Empty ? "_______________________________" : value; ;                        
            AllLabel[i].Visible = true;
            AllLabel[i].CssClass = "lblvalue";
            AllTextBox[i].Visible = false;
        }
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {
        btnPrint.Visible = false;
        btnSubmit.Visible = true;
        List<TextBox> AllTextBox = pnlBody.Controls.OfType<TextBox>().ToList<TextBox>();        
        List<Label> AllLabel = pnlBody.Controls.OfType<Label>().ToList<Label>();

        for (int i=0; i< AllLabel.Count; i++)
        {
            AllLabel[i].Text = string.Empty;
            AllTextBox[i].Text = string.Empty;
            AllLabel[i].Visible = false;            
            AllTextBox[i].Visible = true;
        }
    }    
}